package org.software.service;
import java.util.List;
import org.software.entity.Group;
import org.software.dao.GroupDao;
import org.software.dao.GroupDataProvider;


public class GroupService {
//    private GroupDataProvider groupDataProvider=new GroupDataProvider();
//
//    public boolean groupAdd(String groupName, String className) {
//        return groupDataProvider.groupAdd(groupName, className);
//    }
//    public boolean groupDelete(String groupName) {
//        return groupDataProvider.groupDelete(groupName);
//    }
//    public boolean groupUpdate(String groupName,String newGroupName) {
//        return groupDataProvider.groupUpdate(groupName, newGroupName);
//    }
//    public List<Group> groupQuery() {return groupDataProvider.groupQuery();}
    private GroupDao groupDao;
public boolean groupAdd(String groupName,String className){
    groupDao = new GroupDao();
    return groupDao.groupAdd(groupName,className);
}
    public boolean groupDelete(String groupName){
        groupDao = new GroupDao();
        return groupDao.groupDelete(groupName);
    }
    public boolean groupUpdate(String groupName,String newGroupName){
        groupDao = new GroupDao();
        return groupDao.groupUpdate(groupName,newGroupName);
    }
    public List<Group> groupQuery(){
        groupDao = new GroupDao();
        return groupDao.groupQuery();
    }
    public List<Group> groupQueryByName(String groupName){
        groupDao = new GroupDao();
        return groupDao.groupQueryByName(groupName);
    }
    public List<Group> groupQueryByClassName(String className){
        groupDao = new GroupDao();
        return groupDao.groupQueryByClassName(className);
    }
}
